#include <stdio.h>
#include <math.h>
int main(int argc, char *argv[]) {

    int n, m = 0;
    while (scanf("%d %d",&n,&m)!=EOF && (n!=0&&m!=0))
    {
        int num = 0;
        num = (int)(floor(sqrt(m)) - floor(sqrt(n)) + 1);
        
        printf("%d\n", num);
    }
    

    return 0;
}